<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <jsp:include page="/common/backend_common.jsp"/>
    <jsp:include page="/common/page.jsp"/>
    <script type="text/javascript" src="/ztree/jquery.ztree.all.min.js"></script>

    <script type="text/javascript" src="/assets/js/jquery.bootstrap-duallistbox.min.js"></script>
    <script type="text/javascript" src="/js/shop/origin.js"></script>

</head>
<body class="no-skin" youdao="bind" style="background: white">
<input id="gritter-light" checked="" type="checkbox" class="ace ace-switch ace-switch-5"/>

<div class="page-header">
    <h1>
        商品管理
        <small>
            <i class="ace-icon fa fa-angle-double-right"></i>
            管理商品上架
        </small>
    </h1>
</div>
<div class="main-content-inner">
    <div class="col-sm-12">
        <div class="col-xs-12">
            <div class="table-header">
                商品列表&nbsp;&nbsp;
                <a class="green" href="#">
                    <i class="ace-icon fa fa-plus-circle orange bigger-130 origin-add"></i>
                </a>
            </div>
            <div>
                <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="dataTables_length" id="dynamic-table_length"><label>
                                展示
                                <select id="pageSize" name="dynamic-table_length" aria-controls="dynamic-table" class="form-control input-sm">
                                    <option value="10">10</option>
                                    <option value="25">25</option>
                                    <option value="50">50</option>
                                    <option value="100">100</option>
                                </select> 条记录 </label>


                                <input id="search-number" type="search" name="number" class="form-control input-sm" placeholder="商品编号" aria-controls="dynamic-table">
                                <input id="search-name" type="search" name="name" class="form-control input-sm" placeholder="商品名称" aria-controls="dynamic-table">
                                <input id="search-bar" type="search" name="bar" class="form-control input-sm" placeholder="商品条码" aria-controls="dynamic-table">
                                <input id="search-company"type="search" name="company" class="form-control input-sm" placeholder="商品单位" aria-controls="dynamic-table">

                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <button class="btn btn-info fa fa-check research" style="margin-bottom: 6px;" type="button">
                                    刷新
                                </button>
                            </div>
                        </div>
                        <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid"
                               aria-describedby="dynamic-table_info" style="font-size:14px">
                            <thead>
                            <tr role="row">
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品编号
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品名称
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品价格
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品数量
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品总价
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品条码
                                </th>
                                <th tabindex="0" aria-controls="dynamic-table" rowspan="1" colspan="1">
                                    商品单位
                                </th>

                                <th class="sorting_disabled" rowspan="1" colspan="1" aria-label=""></th>
                            </tr>
                            </thead>
                            <tbody id="originList"></tbody>
                        </table>
                        <div class="row" id="originPage">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
    <div id="dialog-origin-form" style="display: none;">
        <form id="originForm">
            <table class="table table-striped table-bordered table-hover dataTable no-footer" role="grid">
                <tr>
                    <td><label for="shopNumber">商品编号</label></td>
                    <td>
                        <input type="text" name="shopNumber" id="shopNumber" value="" class="text ui-widget-content ui-corner-all">
                        <input type="hidden" name="originId" id="originId"/>
                    </td>
                </tr>
                <tr>
                    <td><label for="shopName">商品名称</label></td>
                    <td>
                        <input type="text" name="shopName" id="shopName" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>
                <tr>
                    <td><label for="shopPrice">商品价格</label></td>
                    <td>
                        <input type="number" name="shopPrice" id="shopPrice" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>
                <tr>
                    <td><label for="quantity">商品数量</label></td>
                    <td>
                        <input type="number" name="quantity" id="quantity" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>
                <tr>
                    <td><label for="amount">商品总价</label></td>
                    <td>
                        <input type="number" name="amount" id="amount" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>
                <tr>
                    <td><label for="shopBar">商品条码</label></td>
                    <td>
                        <input type="text" name="shopBar" id="shopBar" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>
                <tr>
                    <td><label for="shopCompany">商品单位</label></td>
                    <td>
                        <input type="text" name="shopCompany" id="shopCompany" value="" class="text ui-widget-content ui-corner-all">

                    </td>
                </tr>


            </table>
        </form>
    </div>

    <script id="originListTemplate" type="x-tmpl-mustache">
        {{#originList}}
            <tr role="row" class="config odd" data-id="{{originId}}"><!--even -->
                <td>{{shopNumber}}</td>
                <td><a href="#" class="origin-show" data-id="{{originId}}">{{shopName}}</td>
                <td>{{shopPrice}}</td>
                <td>{{quantity}}</td>
                <td>{{amount}}</td>
                <td>{{shopBar}}</td>
                <td>{{shopCompany}}</td>
                <td>
                    <div class="hidden-sm hidden-xs action-buttons">
                        <a class="green origin-edit" href="#" data-id="{{originId}}">
                            <i class="ace-icon fa fa-pencil bigger-100"></i>
                        </a>
                        &nbsp;
                        <a class="red origin-delete" href="#" data-id="{{originId}}" data-name="{{shopName}}">
                            <i class="ace-icon fa fa-trash-o bigger-100"></i>
                        </a>
                    </div>
                </td>
            </tr>
        {{/originList}}


    </script>

    <script type="text/javascript">

        $(function (){
            origin.detail.init({
                pageSize : $("#pageSize").val(),
                pageNo : $("#originPage .pageNo").val() || 1
            });
        });

    </script>

</body>
</html>